Skip to content

test: Add --ignore and --collect-only and use them in CI - #1683

Merged
chfast merged 3 commits into
masterfrom
test/collect-only-ignore
Aug 29, 2026
Merged

test: Add --ignore and --collect-only and use them in CI#1683
chfast merged 3 commits into
masterfrom
test/collect-only-ignore

Conversation

@chfast

@chfast chfast commented Aug 29, 2026

Copy link
Copy Markdown
Member

Both flags follow pytest. --ignore drops a path from the collection; it is repeatable and matches
whole path components, so --ignore bc4895 keeps bc4895-withdrawals. The path is relative to the
test directory being searched rather than to the working directory as pytest resolves it, which is
what keeps the CI exclusions below one word each. --collect-only prints the path of each collected
test, one per line: the file for a test collected from a directory, path::case for a file given
directly.

Every path CI excluded through --gtest_filter is a plain path, so the patterns port one for one,
and --collect-only replaces --gtest_list_tests in the three listing tests, which now pin the
collection order across roots instead of gtest's regrouping by suite name. ethereum-tests runs the
same 479 ValidBlocks and 221 InvalidBlocks tests as on master, and the execution-spec-tests jobs the
same 8281 state and 8731 blockchain tests.

The last commit drops statetest's built-in skip list: those five names are legacy GeneralStateTests
suites CI has not run since it moved to evmone-blockchaintest, and the list was inert anyway because
the jobs passed --gtest_filter='*' over it. After this nothing in the repo passes a --gtest_*
flag except evmone-unittests, which keeps gtest.

@codspeed-hq

codspeed-hq Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 129 untouched benchmarks


Comparing test/collect-only-ignore (df54d9f) with master (14ed4ad)

Open in CodSpeed

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.93%. Comparing base (14ed4ad) to head (df54d9f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1683   +/-   ##
=======================================
  Coverage   97.93%   97.93%           
=======================================
  Files         178      179    +1     
  Lines       15995    16063   +68     
  Branches     3664     3679   +15     
=======================================
+ Hits        15664    15732   +68     
  Misses        252      252           
  Partials       79       79           
Flag Coverage Δ
eest-develop 87.48% <67.27%> (-0.18%) ⬇️
eest-develop-gmp 26.20% <26.66%> (+0.08%) ⬆️
eest-legacy 16.96% <30.66%> (+0.08%) ⬆️
eest-libsecp256k1 28.42% <26.66%> (+0.08%) ⬆️
eest-stable 87.45% <63.63%> (-0.21%) ⬇️
evmone-unittests 94.16% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 96.19% <ø> (ø)
tooling 93.56% <100.00%> (+0.12%) ⬆️
tests 99.81% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
test/blockchaintest/blockchaintest.cpp 97.22% <100.00%> (+0.85%) ⬆️
test/statetest/statetest.cpp 97.46% <100.00%> (+0.32%) ⬆️
test/unittests/test_files_test.cpp 100.00% <100.00%> (ø)
test/utils/test_files.cpp 100.00% <100.00%> (ø)
test/utils/test_files.hpp 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread test/blockchaintest/blockchaintest.cpp Outdated

bool collect_only = false;
app.add_flag("--collect-only", collect_only,
"List the id of each test that would run, one per line, and exit.");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it lists path, not id

Comment thread test/blockchaintest/blockchaintest.cpp Outdated
#include <test/utils/test_files.hpp>
#include <test/utils/test_report.hpp>
#include <iostream>
#include <span>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip this include

Comment thread test/statetest/statetest.cpp Outdated
#include <test/utils/test_files.hpp>
#include <test/utils/test_report.hpp>
#include <iostream>
#include <span>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip this include

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds pytest-style test collection controls and migrates CI away from GoogleTest filtering.

Changes:

  • Adds repeatable --ignore and --collect-only options.
  • Adds path-filtering unit and integration tests.
  • Converts CI exclusions and collection listings to the new options.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/utils/test_files.hpp Declares ignore filtering API.
test/utils/test_files.cpp Implements component-aware filtering.
test/unittests/test_files_test.cpp Tests ignore behavior.
test/unittests/CMakeLists.txt Registers the new unit test.
test/statetest/statetest.cpp Adds collection options to state tests.
test/blockchaintest/blockchaintest.cpp Adds collection options to blockchain tests.
test/integration/statetest/CMakeLists.txt Tests state-test collection behavior.
test/integration/blockchaintest/CMakeLists.txt Tests blockchain-test collection behavior.
test/integration/export/CMakeLists.txt Migrates exported-test exclusion.
circle.yml Migrates CI filters to ignored paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/utils/test_files.cpp Outdated
Comment on lines +42 to +46
auto p = prefix.lexically_normal();
if (p.filename().empty())
p = p.parent_path();
// An empty prefix, which an unset variable expands to, names nothing rather than everything.
return !p.empty() && std::ranges::mismatch(p, path).in1 == p.end();
@chfast
chfast force-pushed the test/collect-only-ignore branch 2 times, most recently from c9fbaa0 to 8737a9e Compare August 29, 2026 20:18
chfast added 3 commits August 29, 2026 22:41
Both flags follow pytest. --ignore drops a path, relative to a test
directory, from the collection; it is repeatable and matches whole path
components, so --ignore bc4895 keeps bc4895-withdrawals. --collect-only
prints the id of each test that would run, one per line: the file for a
test collected from a directory, path::case for a file given directly.
The gtest flags keep working and nothing passes the new ones yet.
Every path CI excluded through --gtest_filter is a plain path, so the
patterns port one for one; the run_execution_spec_tests filter parameter
becomes the flags themselves. --collect-only replaces --gtest_list_tests
in the three listing tests, which now pin the collection order across
roots instead of gtest's regrouping by suite name.
The five excluded names are legacy GeneralStateTests suites which CI has
not run since it moved to evmone-blockchaintest, and the exclusion was
inert anyway: the execution-spec-tests jobs passed --gtest_filter='*',
which overrode it.
@chfast
chfast force-pushed the test/collect-only-ignore branch from 8737a9e to df54d9f Compare August 29, 2026 20:42
@chfast
chfast merged commit 01d0e0f into master Aug 29, 2026
25 checks passed
@chfast
chfast deleted the test/collect-only-ignore branch August 29, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants